import request from '@/utils/request'

// 查询题目信息列表
export function listTopic(query) {
  return request({
    url: '/topic/topic/list',
    method: 'get',
    params: query
  })
}

// 查询题目信息详细
export function getTopic(topicId) {
  return request({
    url: '/topic/topic/' + topicId,
    method: 'get'
  })
}

// 新增题目信息
export function addTopic(data) {
  return request({
    url: '/topic/topic',
    method: 'post',
    data: data
  })
}

// 修改题目信息
export function updateTopic(data) {
  return request({
    url: '/topic/topic',
    method: 'put',
    data: data
  })
}

// 删除题目信息
export function delTopic(topicId) {
  return request({
    url: '/topic/topic/' + topicId,
    method: 'delete'
  })
}

// 查询自己指导的课程
export function listBySelf() {
  return request({
    url: '/studentcourse/studentCourse/listByTeacherSelf',
    method: 'get',
  })
}

// 提交题目信息
export function submit(topicIds) {
  return request({
    url: '/topic/topic/submit/' + topicIds,
    method: 'put'
  })
}

// 审核通过
export function pass(topicIds) {
  return request({
    url: '/topic/topic/pass/' + topicIds,
    method: 'put'
  })
}

// 审核不通过
export function fail(topicIds) {
  return request({
    url: '/topic/topic/fail/' + topicIds,
    method: 'put'
  })
}

// 学生选题
export function chooseTopic(topicId) {
  return request({
    url: '/topic/topic/chooseTopic/' + topicId,
    method: 'put'
  })
}

// 指导教师开题
export function start(topicId) {
  return request({
    url: '/topic/topic/start/' + topicId,
    method: 'put'
  })
}

// 学生提交材料
export function stuSubmit(data) {
  return request({
    url: '/topic/topic/stuSubmit',
    method: 'put',
    data: data
  })
}

// 学生预约
export function appoint(topicId) {
  return request({
    url: '/topic/topic/appoint/' + topicId,
    method: 'put'
  })
}

// 教师同意
export function accept(topicId) {
  return request({
    url: '/topic/topic/accept/' + topicId,
    method: 'put'
  })
}

// 教师不同意
export function reject(topicId) {
  return request({
    url: '/topic/topic/reject/' + topicId,
    method: 'put'
  })
}
